<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>攻防世界的wp(一) | heit0ng</title><meta name="author" content="heit0ng"><meta name="copyright" content="heit0ng"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="先把攻防世界新手区的传上来 先传一部分上来之后慢慢补吧，开学了可能有点慢 之前没做wp，现在相当于重做了一下，顺便用刚学了的py来写一下 有空更新 最后是一道迷宫题，这里简单的讲一下迷宫题的做法 game直接进入main函数会看到这个 1234567891011121314151617181920212223242526272829303132333435363738394041424344454">
<meta property="og:type" content="article">
<meta property="og:title" content="攻防世界的wp(一)">
<meta property="og:url" content="https://heit0ng.gitee.io/2022/02/22/%E6%94%BB%E9%98%B2%E4%B8%96%E7%95%8C%E7%9A%84wp/index.html">
<meta property="og:site_name" content="heit0ng">
<meta property="og:description" content="先把攻防世界新手区的传上来 先传一部分上来之后慢慢补吧，开学了可能有点慢 之前没做wp，现在相当于重做了一下，顺便用刚学了的py来写一下 有空更新 最后是一道迷宫题，这里简单的讲一下迷宫题的做法 game直接进入main函数会看到这个 1234567891011121314151617181920212223242526272829303132333435363738394041424344454">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://s2.loli.net/2022/02/22/Wy6vfC23Rpqx8L4.jpg">
<meta property="article:published_time" content="2022-02-22T15:47:24.726Z">
<meta property="article:modified_time" content="2022-02-26T08:44:05.126Z">
<meta property="article:author" content="heit0ng">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://s2.loli.net/2022/02/22/Wy6vfC23Rpqx8L4.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://heit0ng.gitee.io/2022/02/22/%E6%94%BB%E9%98%B2%E4%B8%96%E7%95%8C%E7%9A%84wp/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '攻防世界的wp(一)',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-02-26 16:44:05'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://s2.loli.net/2022/01/28/RkXzVpjubg3yGEI.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">11</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div></div><hr/></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://s2.loli.net/2022/02/22/Wy6vfC23Rpqx8L4.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">heit0ng</a></span><div id="menus"><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">攻防世界的wp(一)</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-02-22T15:47:24.726Z" title="发表于 2022-02-22 23:47:24">2022-02-22</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-02-26T08:44:05.126Z" title="更新于 2022-02-26 16:44:05">2022-02-26</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="攻防世界的wp(一)"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><p>先把攻防世界新手区的传上来</p>
<p>先传一部分上来之后慢慢补吧，开学了可能有点慢</p>
<p>之前没做wp，现在相当于重做了一下，顺便用刚学了的py来写一下</p>
<p>有空更新</p>
<p>最后是一道迷宫题，这里简单的讲一下迷宫题的做法</p>
<h3 id="game"><a href="#game" class="headerlink" title="game"></a>game</h3><p>直接进入main函数会看到这个</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br></pre></td><td class="code"><pre><span class="line">int __cdecl main_0(int argc, const char **argv, const char **envp)</span><br><span class="line">&#123;</span><br><span class="line">  int i; // [esp+DCh] [ebp-20h]</span><br><span class="line">  int v5; // [esp+F4h] [ebp-8h] BYREF</span><br><span class="line"></span><br><span class="line">  sub_45A7BE(&amp;unk_50B110);</span><br><span class="line">  sub_45A7BE(&amp;unk_50B158);</span><br><span class="line">  sub_45A7BE(&amp;unk_50B1A0);</span><br><span class="line">  sub_45A7BE(&amp;unk_50B1E8);</span><br><span class="line">  sub_45A7BE(&amp;unk_50B230);</span><br><span class="line">  sub_45A7BE(&amp;unk_50B278);</span><br><span class="line">  sub_45A7BE(&amp;unk_50B2C0);</span><br><span class="line">  sub_45A7BE(&amp;unk_50B308);</span><br><span class="line">  sub_45A7BE(&amp;unk_50AFD0);</span><br><span class="line">  sub_45A7BE(&quot;|              by 0x61                                 |\n&quot;);</span><br><span class="line">  sub_45A7BE(&quot;|                                                      |\n&quot;);</span><br><span class="line">  sub_45A7BE(&quot;|------------------------------------------------------|\n&quot;);</span><br><span class="line">  sub_45A7BE(</span><br><span class="line">    &quot;Play a game\n&quot;</span><br><span class="line">    &quot;The n is the serial number of the lamp,and m is the state of the lamp\n&quot;</span><br><span class="line">    &quot;If m of the Nth lamp is 1,it&#x27;s on ,if not it&#x27;s off\n&quot;</span><br><span class="line">    &quot;At first all the lights were closed\n&quot;);</span><br><span class="line">  sub_45A7BE(&quot;Now you can input n to change its state\n&quot;);</span><br><span class="line">  sub_45A7BE(</span><br><span class="line">    &quot;But you should pay attention to one thing,if you change the state of the Nth lamp,the state of (N-1)th and (N+1)th w&quot;</span><br><span class="line">    &quot;ill be changed too\n&quot;);</span><br><span class="line">  sub_45A7BE(&quot;When all lamps are on,flag will appear\n&quot;);</span><br><span class="line">  sub_45A7BE(&quot;Now,input n \n&quot;);</span><br><span class="line">  while ( 1 )</span><br><span class="line">  &#123;</span><br><span class="line">    while ( 1 )</span><br><span class="line">    &#123;</span><br><span class="line">      sub_45A7BE(&quot;input n,n(1-8)\n&quot;);</span><br><span class="line">      sub_459418();</span><br><span class="line">      sub_45A7BE(&quot;n=&quot;);</span><br><span class="line">      sub_4596D4(&quot;%d&quot;, &amp;v5);</span><br><span class="line">      sub_45A7BE(&quot;\n&quot;);</span><br><span class="line">      if ( v5 &gt;= 0 &amp;&amp; v5 &lt;= 8 )</span><br><span class="line">        break;</span><br><span class="line">      sub_45A7BE(&quot;sorry,n error,try again\n&quot;);</span><br><span class="line">    &#125;</span><br><span class="line">    if ( v5 )</span><br><span class="line">    &#123;</span><br><span class="line">      sub_4576D6(v5 - 1);</span><br><span class="line">    &#125;</span><br><span class="line">    else</span><br><span class="line">    &#123;</span><br><span class="line">      for ( i = 0; i &lt; 8; ++i )</span><br><span class="line">      &#123;</span><br><span class="line">        if ( (unsigned int)i &gt;= 9 )</span><br><span class="line">          sub_458919();</span><br><span class="line">        byte_532E28[i] = 0;</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    sub_4581B7(&quot;CLS&quot;);</span><br><span class="line">    sub_458054();</span><br><span class="line">    if ( byte_532E28[0] == 1</span><br><span class="line">      &amp;&amp; byte_532E28[1] == 1</span><br><span class="line">      &amp;&amp; byte_532E28[2] == 1</span><br><span class="line">      &amp;&amp; byte_532E28[3] == 1</span><br><span class="line">      &amp;&amp; byte_532E28[4] == 1</span><br><span class="line">      &amp;&amp; byte_532E28[5] == 1</span><br><span class="line">      &amp;&amp; byte_532E28[6] == 1</span><br><span class="line">      &amp;&amp; byte_532E28[7] == 1 )</span><br><span class="line">    &#123;</span><br><span class="line">      sub_457AB4();</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>

<p>翻译一下英语</p>
<p><img src="https://s2.loli.net/2022/02/22/Akgmrj1vsBGtZWn.png" alt="1号.png"></p>
<p>我们可以按照他说的方法玩这个游戏，可以直接得到flag，这里就不做了，可以做出来的，亲测有效</p>
<p>那几排等于1的代码意思就是当等全部亮的时候我们猜测最下方那个就是得到flag的地方</p>
<p>我们直接点击进入最下方的sub_456AB4()</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br></pre></td><td class="code"><pre><span class="line">int sub_45E940()</span><br><span class="line">&#123;</span><br><span class="line">  int i; // [esp+D0h] [ebp-94h]</span><br><span class="line">  char v2[22]; // [esp+DCh] [ebp-88h] BYREF</span><br><span class="line">  char v3[32]; // [esp+F2h] [ebp-72h] BYREF</span><br><span class="line">  char v4[4]; // [esp+112h] [ebp-52h] BYREF</span><br><span class="line">  char v5[64]; // [esp+120h] [ebp-44h]</span><br><span class="line">  </span><br><span class="line">  sub_45A7BE(&quot;done!!! the flag is &quot;);</span><br><span class="line">  v5[0] = 18;</span><br><span class="line">  v5[1] = 64;</span><br><span class="line">  v5[2] = 98;</span><br><span class="line">  v5[3] = 5;</span><br><span class="line">  v5[4] = 2;</span><br><span class="line">  v5[5] = 4;</span><br><span class="line">  v5[6] = 6;</span><br><span class="line">  v5[7] = 3;</span><br><span class="line">  v5[8] = 6;</span><br><span class="line">  v5[9] = 48;</span><br><span class="line">  v5[10] = 49;</span><br><span class="line">  v5[11] = 65;</span><br><span class="line">  v5[12] = 32;</span><br><span class="line">  v5[13] = 12;</span><br><span class="line">  v5[14] = 48;</span><br><span class="line">  v5[15] = 65;</span><br><span class="line">  v5[16] = 31;</span><br><span class="line">  v5[17] = 78;</span><br><span class="line">  v5[18] = 62;</span><br><span class="line">  v5[19] = 32;</span><br><span class="line">  v5[20] = 49;</span><br><span class="line">  v5[21] = 32;</span><br><span class="line">  v5[22] = 1;</span><br><span class="line">  v5[23] = 57;</span><br><span class="line">  v5[24] = 96;</span><br><span class="line">  v5[25] = 3;</span><br><span class="line">  v5[26] = 21;</span><br><span class="line">  v5[27] = 9;</span><br><span class="line">  v5[28] = 4;</span><br><span class="line">  v5[29] = 62;</span><br><span class="line">  v5[30] = 3;</span><br><span class="line">  v5[31] = 5;</span><br><span class="line">  v5[32] = 4;</span><br><span class="line">  v5[33] = 1;</span><br><span class="line">  v5[34] = 2;</span><br><span class="line">  v5[35] = 3;</span><br><span class="line">  v5[36] = 44;</span><br><span class="line">  v5[37] = 65;</span><br><span class="line">  v5[38] = 78;</span><br><span class="line">  v5[39] = 32;</span><br><span class="line">  v5[40] = 16;</span><br><span class="line">  v5[41] = 97;</span><br><span class="line">  v5[42] = 54;</span><br><span class="line">  v5[43] = 16;</span><br><span class="line">  v5[44] = 44;</span><br><span class="line">  v5[45] = 52;</span><br><span class="line">  v5[46] = 32;</span><br><span class="line">  v5[47] = 64;</span><br><span class="line">  v5[48] = 89;</span><br><span class="line">  v5[49] = 45;</span><br><span class="line">  v5[50] = 32;</span><br><span class="line">  v5[51] = 65;</span><br><span class="line">  v5[52] = 15;</span><br><span class="line">  v5[53] = 34;</span><br><span class="line">  v5[54] = 18;</span><br><span class="line">  v5[55] = 16;</span><br><span class="line">  v5[56] = 0;</span><br><span class="line">  qmemcpy(v2, &quot;&#123; &quot;, 2);</span><br><span class="line">  v2[2] = 18;</span><br><span class="line">  v2[3] = 98;</span><br><span class="line">  v2[4] = 119;</span><br><span class="line">  v2[5] = 108;</span><br><span class="line">  v2[6] = 65;</span><br><span class="line">  v2[7] = 41;</span><br><span class="line">  v2[8] = 124;</span><br><span class="line">  v2[9] = 80;</span><br><span class="line">  v2[10] = 125;</span><br><span class="line">  v2[11] = 38;</span><br><span class="line">  v2[12] = 124;</span><br><span class="line">  v2[13] = 111;</span><br><span class="line">  v2[14] = 74;</span><br><span class="line">  v2[15] = 49;</span><br><span class="line">  v2[16] = 83;</span><br><span class="line">  v2[17] = 108;</span><br><span class="line">  v2[18] = 94;</span><br><span class="line">  v2[19] = 108;</span><br><span class="line">  v2[20] = 84;</span><br><span class="line">  v2[21] = 6;</span><br><span class="line">  qmemcpy(v3, &quot;`S,yhn _uec&#123;&quot;, 12);</span><br><span class="line">  v3[12] = 127;</span><br><span class="line">  v3[13] = 119;</span><br><span class="line">  v3[14] = 96;</span><br><span class="line">  v3[15] = 48;</span><br><span class="line">  v3[16] = 107;</span><br><span class="line">  v3[17] = 71;</span><br><span class="line">  v3[18] = 92;</span><br><span class="line">  v3[19] = 29;</span><br><span class="line">  v3[20] = 81;</span><br><span class="line">  v3[21] = 107;</span><br><span class="line">  v3[22] = 90;</span><br><span class="line">  v3[23] = 85;</span><br><span class="line">  v3[24] = 64;</span><br><span class="line">  v3[25] = 12;</span><br><span class="line">  v3[26] = 43;</span><br><span class="line">  v3[27] = 76;</span><br><span class="line">  v3[28] = 86;</span><br><span class="line">  v3[29] = 13;</span><br><span class="line">  v3[30] = 114;</span><br><span class="line">  v3[31] = 1;</span><br><span class="line">  strcpy(v4, &quot;u~&quot;);</span><br><span class="line">  for ( i = 0; i &lt; 56; ++i )</span><br><span class="line">  &#123;</span><br><span class="line">    v2[i] ^= v5[i];</span><br><span class="line">    v2[i] ^= 0x13u;</span><br><span class="line">  &#125;</span><br><span class="line">  return sub_45A7BE(&quot;%s\n&quot;);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>python编写</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">a = [18,64,98,5,2,4,6,3,6,48,49,65,32,12,48,65,31,78,62,32,49,32,</span><br><span class="line">     1,57,96,3,21,9,4,62,3,5,4,1,2,3,44,65,78,32,16,97,54,16,44,52,32,64,89,45,32,65,</span><br><span class="line">     15,34,18,16,0]</span><br><span class="line">b = [123,32,18,98,119,108,65,41,124,80,125,38,124,111,74,49,83,108,</span><br><span class="line">     94,108,84,6,96,83,44,121,104,110,32,95,117,101,99,123,127,119,96,48,</span><br><span class="line">     107,71,92,29,81,107,90,85,64,12,43,76,86,13,114,1,117,126,0]</span><br><span class="line">c=&#x27;&#x27;</span><br><span class="line">for i in range(56):</span><br><span class="line">    a[i]^=b[i]</span><br><span class="line">    a[i]^=0x13</span><br><span class="line">    c=c+chr(a[i])</span><br><span class="line">print(c)</span><br></pre></td></tr></table></figure>

<h3 id="open-source"><a href="#open-source" class="headerlink" title="open-source"></a>open-source</h3><p>他直接给的源代码</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;string.h&gt;</span><br><span class="line"></span><br><span class="line">int main(int argc, char *argv[]) &#123;</span><br><span class="line">    if (argc != 4) &#123;</span><br><span class="line">    	printf(&quot;what?\n&quot;);</span><br><span class="line">    	exit(1);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    unsigned int first = atoi(argv[1]);</span><br><span class="line">    if (first != 0xcafe) &#123;</span><br><span class="line">    	printf(&quot;you are wrong, sorry.\n&quot;);</span><br><span class="line">    	exit(2);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    unsigned int second = atoi(argv[2]);</span><br><span class="line">    if (second % 5 == 3 || second % 17 != 8) &#123;</span><br><span class="line">    	printf(&quot;ha, you won&#x27;t get it!\n&quot;);</span><br><span class="line">    	exit(3);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    if (strcmp(&quot;h4cky0u&quot;, argv[3])) &#123;</span><br><span class="line">    	printf(&quot;so close, dude!\n&quot;);</span><br><span class="line">    	exit(4);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    printf(&quot;Brr wrrr grr\n&quot;);</span><br><span class="line"></span><br><span class="line">    unsigned int hash = first * 31337 + (second % 17) * 11 + strlen(argv[3]) - 1615810207;</span><br><span class="line"></span><br><span class="line">    printf(&quot;Get your key: &quot;);</span><br><span class="line">    printf(&quot;%x\n&quot;, hash);</span><br><span class="line">    return 0;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>第一个参数轻松得到，第二个需要算一下，发现25是正确的，第三个为长度，最后写脚本用16进制输出得到</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">first = 0xcafe</span><br><span class="line">second = 25</span><br><span class="line">third = 7</span><br><span class="line">hash= int(first * 31337 + (second % 17) * 11 + 7- 1615810207)</span><br><span class="line">print(hex(hash))</span><br></pre></td></tr></table></figure>

<h3 id="simple-unpack"><a href="#simple-unpack" class="headerlink" title="simple-unpack"></a>simple-unpack</h3><p>就考一个upx的脱壳<img src="https://s2.loli.net/2022/02/22/ZAmTitVlsLMDYJ4.png" alt="2号.png"></p>
<p>记得放在和脱壳软件同一个目录下</p>
<p>直接进去就有flag了</p>
<h3 id="logmein"><a href="#logmein" class="headerlink" title="logmein"></a>logmein</h3><p>一个简单的rc3</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">void __fastcall __noreturn main(int a1, char **a2, char **a3)</span><br><span class="line">&#123;</span><br><span class="line">  size_t v3; // rsi</span><br><span class="line">  int i; // [rsp+3Ch] [rbp-54h]</span><br><span class="line">  char s[36]; // [rsp+40h] [rbp-50h] BYREF</span><br><span class="line">  int v6; // [rsp+64h] [rbp-2Ch]</span><br><span class="line">  __int64 v7; // [rsp+68h] [rbp-28h]</span><br><span class="line">  char v8[28]; // [rsp+70h] [rbp-20h] BYREF</span><br><span class="line">  int v9; // [rsp+8Ch] [rbp-4h]</span><br><span class="line"></span><br><span class="line">  v9 = 0;</span><br><span class="line">  strcpy(v8, &quot;:\&quot;AL_RT^L*.?+6/46&quot;);</span><br><span class="line">  v7 = &#x27;ebmarah&#x27;;</span><br><span class="line">  v6 = 7;</span><br><span class="line">  printf(&quot;Welcome to the RC3 secure password guesser.\n&quot;);</span><br><span class="line">  printf(&quot;To continue, you must enter the correct password.\n&quot;);</span><br><span class="line">  printf(&quot;Enter your guess: &quot;);</span><br><span class="line">  __isoc99_scanf(&quot;%32s&quot;, s);</span><br><span class="line">  v3 = strlen(s);</span><br><span class="line">  if ( v3 &lt; strlen(v8) )</span><br><span class="line">    sub_4007C0();</span><br><span class="line">  for ( i = 0; i &lt; strlen(s); ++i )</span><br><span class="line">  &#123;</span><br><span class="line">    if ( i &gt;= strlen(v8) )</span><br><span class="line">      sub_4007C0();</span><br><span class="line">    if ( s[i] != (*(&amp;v7 + i % v6) ^ v8[i]) )</span><br><span class="line">      sub_4007C0();</span><br><span class="line">  &#125;</span><br><span class="line">  sub_4007F0();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>注意小端为倒序</p>
<p>注意ida里面数组奇怪的表达方式</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">a=&#x27;:\&quot;AL_RT^L*.?+6/46&#x27;</span><br><span class="line">b=&#x27;harambe&#x27;</span><br><span class="line">flag=&#x27;&#x27;</span><br><span class="line">for i in range(len(a)):</span><br><span class="line">    flag+=chr(ord(b[i%7])^ord(a[i]))</span><br><span class="line">print(flag)</span><br></pre></td></tr></table></figure>

<h3 id="insanity"><a href="#insanity" class="headerlink" title="insanity"></a>insanity</h3><p>不是很懂这道题考什么</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">int __cdecl main(int argc, const char **argv, const char **envp)</span><br><span class="line">&#123;</span><br><span class="line">  unsigned int v3; // eax</span><br><span class="line">  unsigned int v4; // eax</span><br><span class="line"></span><br><span class="line">  puts(&quot;Reticulating splines, please wait..&quot;);</span><br><span class="line">  sleep(5u);</span><br><span class="line">  v3 = time(0);</span><br><span class="line">  srand(v3);</span><br><span class="line">  v4 = rand();</span><br><span class="line">  puts((&amp;strs)[v4 % 0xA]);</span><br><span class="line">  return 0;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>直接点strs进入就可以了</p>
<h3 id="getit"><a href="#getit" class="headerlink" title="getit"></a>getit</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line">int __cdecl main(int argc, const char **argv, const char **envp)</span><br><span class="line">&#123;</span><br><span class="line">  char v3; // al</span><br><span class="line">  int i; // [rsp+0h] [rbp-40h]</span><br><span class="line">  int j; // [rsp+4h] [rbp-3Ch]</span><br><span class="line">  FILE *stream; // [rsp+8h] [rbp-38h]</span><br><span class="line">  char filename[24]; // [rsp+10h] [rbp-30h] BYREF</span><br><span class="line">  unsigned __int64 v9; // [rsp+28h] [rbp-18h]</span><br><span class="line"></span><br><span class="line">  v9 = __readfsqword(0x28u);</span><br><span class="line">  for ( i = 0; i &lt; strlen(s); ++i )</span><br><span class="line">  &#123;</span><br><span class="line">    if ( (i &amp; 1) != 0 )</span><br><span class="line">      v3 = 1;</span><br><span class="line">    else</span><br><span class="line">      v3 = -1;</span><br><span class="line">    *(&amp;t + i + 10) = s[i] + v3;</span><br><span class="line">  &#125;</span><br><span class="line">  strcpy(filename, &quot;/tmp/flag.txt&quot;);</span><br><span class="line">  stream = fopen(filename, &quot;w&quot;);</span><br><span class="line">  fprintf(stream, &quot;%s\n&quot;, u);</span><br><span class="line">  for ( j = 0; j &lt; strlen(&amp;t); ++j )</span><br><span class="line">  &#123;</span><br><span class="line">    fseek(stream, p[j], 0);</span><br><span class="line">    fputc(*(&amp;t + p[j]), stream);</span><br><span class="line">    fseek(stream, 0LL, 0);</span><br><span class="line">    fprintf(stream, &quot;%s\n&quot;, u);</span><br><span class="line">  &#125;</span><br><span class="line">  fclose(stream);</span><br><span class="line">  remove(filename);</span><br><span class="line">  return 0;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>这题可以放虚拟机调试得到，这里我们静态分析，比较简单，算法就是第一个for循环里面，数据点进去都有</p>
<p>脚本</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">s=&#x27;c61b68366edeb7bdce3c6820314b7498&#x27;</span><br><span class="line">t=&#x27;&#x27;</span><br><span class="line">for i in range(0,len(s)):</span><br><span class="line">    if (i&amp;1)!=0:</span><br><span class="line">        v3=1</span><br><span class="line">    else:</span><br><span class="line">        v3=-1</span><br><span class="line">    t+=chr(ord(s[i])+v3)</span><br><span class="line">print(t)</span><br></pre></td></tr></table></figure>



<h3 id="python-trade"><a href="#python-trade" class="headerlink" title="python-trade"></a>python-trade</h3><p>可以直接用在线工具把pyc变成py</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">#!/usr/bin/env python</span><br><span class="line"># visit https://tool.lu/pyc/ for more information</span><br><span class="line">import base64</span><br><span class="line"></span><br><span class="line">def encode(message):</span><br><span class="line">    s = &#x27;&#x27;</span><br><span class="line">    for i in message:</span><br><span class="line">        x = ord(i) ^ 32</span><br><span class="line">        x = x + 16</span><br><span class="line">        s += chr(x)</span><br><span class="line">    </span><br><span class="line">    return base64.b64encode(s)</span><br><span class="line"></span><br><span class="line">correct = &#x27;XlNkVmtUI1MgXWBZXCFeKY+AaXNt&#x27;</span><br><span class="line">flag = &#x27;&#x27;</span><br><span class="line">print &#x27;Input flag:&#x27;</span><br><span class="line">flag = raw_input()</span><br><span class="line">if encode(flag) == correct:</span><br><span class="line">    print &#x27;correct&#x27;</span><br><span class="line">else:</span><br><span class="line">    print &#x27;wrong&#x27;</span><br></pre></td></tr></table></figure>

<p>先base64解密再一个异或就结束</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">import base64</span><br><span class="line">b=&#x27;XlNkVmtUI1MgXWBZXCFeKY+AaXNt&#x27;</span><br><span class="line">a = base64.b64decode(b)</span><br><span class="line">flag = &#x27;&#x27;</span><br><span class="line">for i in a:</span><br><span class="line">    x = i-16</span><br><span class="line">    x = x^32</span><br><span class="line">    flag+=chr(x)</span><br><span class="line">print(flag)</span><br></pre></td></tr></table></figure>

<h3 id="re1"><a href="#re1" class="headerlink" title="re1"></a>re1</h3><p>进入</p>
<p><img src="https://s2.loli.net/2022/02/22/OyVSvhIj36pd82Y.png" alt="3号.png"></p>
<p>其实可以大致可以猜到在aFlag里面</p>
<p><img src="https://s2.loli.net/2022/02/22/n9Mxh6uEZ15WSci.png" alt="4号.png"></p>
<p>用R把两段换成字符串形式就可以得到了</p>
<p>主要熟悉各种进制，字符串直接的转化</p>
<h3 id="Hello，CTF"><a href="#Hello，CTF" class="headerlink" title="Hello，CTF"></a>Hello，CTF</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">  strcpy(v13, &quot;437261636b4d654a757374466f7246756e&quot;);</span><br><span class="line">  while ( 1 )</span><br><span class="line">  &#123;</span><br><span class="line">    memset(v10, 0, sizeof(v10));</span><br><span class="line">    v11 = 0;</span><br><span class="line">    v12 = 0;</span><br><span class="line">    printf(aPleaseInputYou, v6);</span><br><span class="line">    scanf(&quot;%s&quot;, v9);</span><br><span class="line">    if ( strlen(v9) &gt; 021 )</span><br><span class="line">      break;</span><br><span class="line">    for ( i = 0; i &lt; 17; ++i )</span><br><span class="line">    &#123;</span><br><span class="line">      v4 = v9[i];</span><br><span class="line">      if ( !v4 )</span><br><span class="line">        break;</span><br><span class="line">      sprintf(Buffer, &quot;%x&quot;, v4);</span><br><span class="line">      strcat(v10, Buffer);</span><br><span class="line">    &#125;</span><br><span class="line">    if ( !strcmp(v10, v13) )</span><br><span class="line">      printf(aSuccess, v7);</span><br><span class="line">    else</span><br><span class="line">      printf(aWrong, v7);</span><br><span class="line">  &#125;</span><br><span class="line">  printf(aWrong, v7);</span><br><span class="line">  result = --Stream._cnt;</span><br><span class="line">  if ( Stream._cnt &lt; 0 )</span><br><span class="line">    return _filbuf(&amp;Stream);</span><br><span class="line">  ++Stream._ptr;</span><br><span class="line">  return result;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>比较简单，就是将一串代码转化成十六进制以后得到v13那串，所以倒回去就可以了</p>
<h3 id="no-strings-attached"><a href="#no-strings-attached" class="headerlink" title="no-strings-attached"></a>no-strings-attached</h3><p>直接进入authenticate里面</p>
<p><img src="https://s2.loli.net/2022/02/22/zoKBxwTfGnsSFlD.png" alt="5号.png"></p>
<p>会发现最后使用ws与s2作比较</p>
<p>s2前面可以通过一个加密得到</p>
<p>点入decrypt得到</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">wchar_t *__cdecl decrypt(wchar_t *s, wchar_t *a2)</span><br><span class="line">&#123;</span><br><span class="line">  size_t v2; // eax</span><br><span class="line">  signed int v4; // [esp+1Ch] [ebp-1Ch]</span><br><span class="line">  signed int i; // [esp+20h] [ebp-18h]</span><br><span class="line">  signed int v6; // [esp+24h] [ebp-14h]</span><br><span class="line">  signed int v7; // [esp+28h] [ebp-10h]</span><br><span class="line">  wchar_t *dest; // [esp+2Ch] [ebp-Ch]</span><br><span class="line"></span><br><span class="line">  v6 = wcslen(s);</span><br><span class="line">  v7 = wcslen(a2);</span><br><span class="line">  v2 = wcslen(s);</span><br><span class="line">  dest = (wchar_t *)malloc(v2 + 1);</span><br><span class="line">  wcscpy(dest, s);</span><br><span class="line">  while ( v4 &lt; v6 )</span><br><span class="line">  &#123;</span><br><span class="line">    for ( i = 0; i &lt; v7 &amp;&amp; v4 &lt; v6; ++i )</span><br><span class="line">      dest[v4++] -= a2[i];</span><br><span class="line">  &#125;</span><br><span class="line">  return dest;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>s对应前面括号里s的数据，a2对应dword的数据，可以用lazy ida转换成py的dowrd导出得到数据</p>
<p>一个简单的减法直接翻译成py的话</p>
<p>ida的代码有时确实有些怪，需要仔细琢磨一下才能明白意思</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">s1=[0x0000143A, 0x00001436, 0x00001437, 0x0000143B, 0x00001480, 0x0000147A, 0x00001471, 0x00001478,</span><br><span class="line">   0x00001463, 0x00001466, 0x00001473, 0x00001467, 0x00001462, 0x00001465, 0x00001473, 0x00001460,</span><br><span class="line">   0x0000146B, 0x00001471, 0x00001478, 0x0000146A, 0x00001473, 0x00001470, 0x00001464, 0x00001478,</span><br><span class="line">   0x0000146E, 0x00001470, 0x00001470, 0x00001464, 0x00001470, 0x00001464, 0x0000146E, 0x0000147B,</span><br><span class="line">   0x00001476, 0x00001478, 0x0000146A, 0x00001473, 0x0000147B, 0x00001480]</span><br><span class="line">s2=[0x00001401, 0x00001402, 0x00001403, 0x00001404, 0x00001405]</span><br><span class="line">a=len(s1)</span><br><span class="line">b=len(s2)</span><br><span class="line">dest=s1</span><br><span class="line">flag=&#x27;&#x27;</span><br><span class="line">v4=0</span><br><span class="line">while v4&lt;a:</span><br><span class="line">    i=0</span><br><span class="line">    while i&lt;b and v4&lt;a:</span><br><span class="line">        dest[v4]-=s2[i]</span><br><span class="line">        flag+=chr(dest[v4])</span><br><span class="line">        i+=1</span><br><span class="line">        v4+=1</span><br><span class="line">print(flag)</span><br></pre></td></tr></table></figure>

<h3 id="csaw2013reversing2"><a href="#csaw2013reversing2" class="headerlink" title="csaw2013reversing2"></a>csaw2013reversing2</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">int __cdecl __noreturn main(int argc, const char **argv, const char **envp)</span><br><span class="line">&#123;</span><br><span class="line">  int v3; // ecx</span><br><span class="line">  CHAR *lpMem; // [esp+8h] [ebp-Ch]</span><br><span class="line">  HANDLE hHeap; // [esp+10h] [ebp-4h]</span><br><span class="line"></span><br><span class="line">  hHeap = HeapCreate(0x40000u, 0, 0);</span><br><span class="line">  lpMem = (CHAR *)HeapAlloc(hHeap, 8u, SourceSize + 1);</span><br><span class="line">  memcpy_s(lpMem, SourceSize, &amp;unk_C59B10, SourceSize);</span><br><span class="line">  if ( !sub_C5102A() &amp;&amp; !IsDebuggerPresent() )</span><br><span class="line">  &#123;</span><br><span class="line">    MessageBoxA(0, lpMem + 1, &quot;Flag&quot;, 2u);</span><br><span class="line">    HeapFree(hHeap, 0, lpMem);</span><br><span class="line">    HeapDestroy(hHeap);</span><br><span class="line">    ExitProcess(0);</span><br><span class="line">  &#125;</span><br><span class="line">  __debugbreak();</span><br><span class="line">  sub_C51000(v3 + 4, lpMem);</span><br><span class="line">  ExitProcess(0xFFFFFFFF);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>用WIN32写的，寒假学了些win32，大致看得懂啥意思</p>
<p>直接看if那里会判断是否处于调试，可以set ip跳过的这个不管</p>
<p>messageboxA执行会显示弹窗</p>
<p><img src="D:\learn\topic\GONGFANG\re图片\6号.png" alt="6号"></p>
<p>但这个是未进行解密的情况，为乱码</p>
<p>解密部分在 sub_C51000(v3 + 4, lpMem);</p>
<p>需要进入调试</p>
<p>跟着单步步入到sub那里点进去</p>
<p><img src="D:\learn\topic\GONGFANG\re图片\7号.png" alt="7号"></p>
<p>int 3是一中断指令我们可以将其nop掉或者直接set ip跳过</p>
<p>然后会执行解密过程，此时再set ip到messagebosA那里执行弹窗，即可获得flag</p>
<h3 id="maze"><a href="#maze" class="headerlink" title="maze"></a>maze</h3><p>1.如何构建迷宫</p>
<p>2.如何判断和表示方向，如上下左右</p>
<p>3.构建出的迷宫什么字符代表路，什么代表墙壁，什么代表终点，从哪里开始</p>
<p>4.如果有多种路径，是否选择最短路径</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br></pre></td><td class="code"><pre><span class="line">__int64 __fastcall main(int a1, char **a2, char **a3)</span><br><span class="line">&#123;</span><br><span class="line">  __int64 v3; // rbx</span><br><span class="line">  int v4; // eax</span><br><span class="line">  char v5; // bp</span><br><span class="line">  char v6; // al</span><br><span class="line">  const char *v7; // rdi</span><br><span class="line">  unsigned int v9; // [rsp+0h] [rbp-28h] BYREF</span><br><span class="line">  int v10[9]; // [rsp+4h] [rbp-24h] BYREF</span><br><span class="line"></span><br><span class="line">  v10[0] = 0;</span><br><span class="line">  v9 = 0;</span><br><span class="line">  puts(&quot;Input flag:&quot;);</span><br><span class="line">  scanf(&quot;%s&quot;, &amp;s1);</span><br><span class="line">  if ( strlen(&amp;s1) != 030 || strncmp(&amp;s1, &quot;nctf&#123;&quot;, 5uLL) || *(&amp;byte_6010BF + 030) != &#x27;&#125;&#x27; )</span><br><span class="line">  &#123;</span><br><span class="line">LABEL_22://失败情况</span><br><span class="line">    puts(&quot;Wrong flag!&quot;);</span><br><span class="line">    exit(-1);</span><br><span class="line">  &#125;</span><br><span class="line">  v3 = 5LL;</span><br><span class="line">  if ( strlen(&amp;s1) - 1 &gt; 5 )</span><br><span class="line">  &#123;</span><br><span class="line">    while ( 1 )</span><br><span class="line">    &#123;</span><br><span class="line">      v4 = *(&amp;s1 + v3);</span><br><span class="line">      v5 = 0;</span><br><span class="line">      if ( v4 &gt; &#x27;N&#x27; )</span><br><span class="line">      &#123;</span><br><span class="line">        if ( v4 == &#x27;O&#x27; )</span><br><span class="line">        &#123;</span><br><span class="line">          v6 = sub_400650(v10);//对V10处理，向左</span><br><span class="line">          goto LABEL_14;</span><br><span class="line">        &#125;</span><br><span class="line">        if ( v4 == &#x27;o&#x27; )</span><br><span class="line">        &#123;</span><br><span class="line">          v6 = sub_400660(v10);//对V10处理，向右</span><br><span class="line">          goto LABEL_14;</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;</span><br><span class="line">      else</span><br><span class="line">      &#123;</span><br><span class="line">        if ( v4 == &#x27;.&#x27; )</span><br><span class="line">        &#123;</span><br><span class="line">          v6 = sub_400670(&amp;v9);//对V9处理，向上</span><br><span class="line">          goto LABEL_14;</span><br><span class="line">        &#125;</span><br><span class="line">        if ( v4 == &#x27;0&#x27; )</span><br><span class="line">        &#123;</span><br><span class="line">          v6 = sub_400680(&amp;v9);//对V9处理，向下</span><br><span class="line">LABEL_14:</span><br><span class="line">          v5 = v6;</span><br><span class="line">          goto LABEL_15;</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;</span><br><span class="line">LABEL_15:</span><br><span class="line">      if ( !sub_400690(asc_601060, v10[0], v9) )</span><br><span class="line">        goto LABEL_22;</span><br><span class="line">      if ( ++v3 &gt;= strlen(&amp;s1) - 1 )</span><br><span class="line">      &#123;</span><br><span class="line">        if ( v5 )</span><br><span class="line">          break;</span><br><span class="line">LABEL_20://失败情况</span><br><span class="line">        v7 = &quot;Wrong flag!&quot;;</span><br><span class="line">        goto LABEL_21;</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">  if ( asc_601060[8 * v9 + v10[0]] != &#x27;#&#x27; )</span><br><span class="line">    goto LABEL_20;</span><br><span class="line">  v7 = &quot;Congratulations!&quot;;</span><br><span class="line">LABEL_21:</span><br><span class="line">  puts(v7);</span><br><span class="line">  return 0LL;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>注意**LABEL_15:**那里</p>
<p>先进入asc会得到字符串</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">*******   *  **** * ****  * ***  *#  *** *** ***     *********</span><br></pre></td></tr></table></figure>

<p>这个就是我们需要构建的迷宫，其实这个已经可以猜出来，8x8的，或者根据伪代码也可以直接判断</p>
<p>（不一定每一个都是正方形哈）</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">  ******</span><br><span class="line">*   *  *</span><br><span class="line">*** * **</span><br><span class="line">**  * **</span><br><span class="line">*  *#  *</span><br><span class="line">** *** *</span><br><span class="line">**     *</span><br><span class="line">********</span><br></pre></td></tr></table></figure>

<p>现在该如何判断V10,V9哪个是行，哪个是列呢</p>
<p>进入sub_400690</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">__int64 __fastcall sub_400690(__int64 a1, int a2, int a3)</span><br><span class="line">&#123;</span><br><span class="line">  __int64 result; // rax</span><br><span class="line"></span><br><span class="line">  result = *(a1 + a2 + 8LL * a3);</span><br><span class="line">  LOBYTE(result) = result == &#x27; &#x27; || result == &#x27;#&#x27;;</span><br><span class="line">  return result;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>a1为字符串那个数组，此时可以将其看为二维数组那么a2即V10就是行，a3即v9就是列此时就可以知道上下左右了</p>
<p>此时即可得到flag   nctf{o0oo00O000oooo..OO}</p>
<h3 id="不一样的flag-buuctf"><a href="#不一样的flag-buuctf" class="headerlink" title="不一样的flag(buuctf)"></a>不一样的flag(buuctf)</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br></pre></td><td class="code"><pre><span class="line">int __cdecl __noreturn main(int argc, const char **argv, const char **envp)</span><br><span class="line">&#123;</span><br><span class="line">  char v3[29]; // [esp+17h] [ebp-35h] BYREF</span><br><span class="line">  int v4; // [esp+34h] [ebp-18h]</span><br><span class="line">  int v5; // [esp+38h] [ebp-14h] BYREF</span><br><span class="line">  int i; // [esp+3Ch] [ebp-10h]</span><br><span class="line">  _BYTE v7[12]; // [esp+40h] [ebp-Ch] BYREF</span><br><span class="line"></span><br><span class="line">  __main();</span><br><span class="line">  v4 = 0;</span><br><span class="line">  strcpy(v3, &quot;*11110100001010000101111#&quot;);</span><br><span class="line">  while ( 1 )</span><br><span class="line">  &#123;</span><br><span class="line">    puts(&quot;you can choose one action to execute&quot;);</span><br><span class="line">    puts(&quot;1 up&quot;);</span><br><span class="line">    puts(&quot;2 down&quot;);</span><br><span class="line">    puts(&quot;3 left&quot;);</span><br><span class="line">    printf(&quot;4 right\n:&quot;);</span><br><span class="line">    scanf(&quot;%d&quot;, &amp;v5);</span><br><span class="line">    if ( v5 == 2 )</span><br><span class="line">    &#123;</span><br><span class="line">      ++*&amp;v3[25];</span><br><span class="line">    &#125;</span><br><span class="line">    else if ( v5 &gt; 2 )</span><br><span class="line">    &#123;</span><br><span class="line">      if ( v5 == 3 )</span><br><span class="line">      &#123;</span><br><span class="line">        --v4;</span><br><span class="line">      &#125;</span><br><span class="line">      else</span><br><span class="line">      &#123;</span><br><span class="line">        if ( v5 != 4 )</span><br><span class="line">LABEL_13:</span><br><span class="line">          exit(1);</span><br><span class="line">        ++v4;</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    else</span><br><span class="line">    &#123;</span><br><span class="line">      if ( v5 != 1 )</span><br><span class="line">        goto LABEL_13;</span><br><span class="line">      --*&amp;v3[25];</span><br><span class="line">    &#125;</span><br><span class="line">    for ( i = 0; i &lt;= 1; ++i )</span><br><span class="line">    &#123;</span><br><span class="line">      if ( *&amp;v3[4 * i + 25] &lt; 0 || *&amp;v3[4 * i + 25] &gt; 4 )</span><br><span class="line">        exit(1);</span><br><span class="line">    &#125;</span><br><span class="line">    if ( v7[5 * *&amp;v3[25] - 41 + v4] == &#x27;1&#x27; )</span><br><span class="line">      exit(1);</span><br><span class="line">    if ( v7[5 * *&amp;v3[25] - 41 + v4] == &#x27;#&#x27; )</span><br><span class="line">    &#123;</span><br><span class="line">      puts(&quot;\nok, the order you enter is the flag!&quot;);</span><br><span class="line">      exit(0);</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>这个比较简单，方向也有，迷宫也容易构建</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">*1111</span><br><span class="line">01000</span><br><span class="line">01010</span><br><span class="line">00010</span><br><span class="line">1111#</span><br></pre></td></tr></table></figure>

<p>很容易得到flag</p>
<h3 id="华师杯2019的迷宫题"><a href="#华师杯2019的迷宫题" class="headerlink" title="华师杯2019的迷宫题"></a>华师杯2019的迷宫题</h3><p>直接进入check主要部分</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">bool __cdecl check(char *flag)</span><br><span class="line">&#123;</span><br><span class="line">  char *v1; // eax</span><br><span class="line">  int v2; // eax</span><br><span class="line">  char *cur; // [esp+Ch] [ebp-4h]</span><br><span class="line"></span><br><span class="line">  cur = &amp;maze[14];//迷宫的字符串，长度为168，14*12的迷宫</span><br><span class="line">  while ( *flag &amp;&amp; *cur != 42 )</span><br><span class="line">  &#123;</span><br><span class="line">    v1 = flag++;</span><br><span class="line">    v2 = *v1;</span><br><span class="line">    if ( v2 == 100 )</span><br><span class="line">    &#123;</span><br><span class="line">      ++cur;//d向右一步</span><br><span class="line">    &#125;</span><br><span class="line">    else if ( v2 &gt; 100 )</span><br><span class="line">    &#123;</span><br><span class="line">      if ( v2 == 115 )</span><br><span class="line">      &#123;</span><br><span class="line">        cur += 13;//s向右13步或者左下一步</span><br><span class="line">      &#125;</span><br><span class="line">      else</span><br><span class="line">      &#123;</span><br><span class="line">        if ( v2 != 119 )</span><br><span class="line">          return 0;</span><br><span class="line">        cur -= 13;//w向右上一步或者向左13步</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    else</span><br><span class="line">    &#123;</span><br><span class="line">      if ( v2 != 97 )</span><br><span class="line">        return 0;</span><br><span class="line">      --cur;a向左一步</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">  return *cur == 35;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>构建迷宫</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">#include&lt;stdio.h&gt;</span><br><span class="line">#include&lt;string.h&gt; </span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">	int i,j;</span><br><span class="line">	char a[]=&quot;**************@************-************-***-**-*****--*****-*****-***#**-*****--**----******-*****-******-****--******---**-*******-*-----******-------*****************&quot;;	</span><br><span class="line">	for(i=0;i&lt;12;i++)</span><br><span class="line">	&#123;</span><br><span class="line">		for(j=0;j&lt;14;j++)</span><br><span class="line">		&#123;</span><br><span class="line">			printf(&quot;%c&quot;,a[i*14+j]);</span><br><span class="line">		&#125;</span><br><span class="line">		putchar(&#x27;\n&#x27;);</span><br><span class="line">	&#125;</span><br><span class="line">	return 0;</span><br><span class="line">&#125; </span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">**************</span><br><span class="line">@************-</span><br><span class="line">************-*</span><br><span class="line">**-**-*****--*</span><br><span class="line">****-*****-***</span><br><span class="line">#**-*****--**-</span><br><span class="line">---******-****</span><br><span class="line">*-******-****-</span><br><span class="line">-******---**-*</span><br><span class="line">******-*-----*</span><br><span class="line">*****-------**</span><br><span class="line">**************</span><br></pre></td></tr></table></figure>

<p>#为终点，@为起点</p>
<p>由题目可知为24步结束</p>
<p>所以手画吧</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">**************</span><br><span class="line">@************①</span><br><span class="line">************②*</span><br><span class="line">**-**-*****③-*</span><br><span class="line">****-*****④***</span><br><span class="line">#**-*****⑤⑥**㉓</span><br><span class="line">㉒㉑⑳ ******⑦****</span><br><span class="line">*⑲ ******⑧****⑰</span><br><span class="line">⑱******⑨⑩⑪**⑯*</span><br><span class="line">******-*⑫⑬⑭⑮-*</span><br><span class="line">*****-------**</span><br><span class="line">**************</span><br></pre></td></tr></table></figure>

</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">heit0ng</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://heit0ng.gitee.io/2022/02/22/%E6%94%BB%E9%98%B2%E4%B8%96%E7%95%8C%E7%9A%84wp/">https://heit0ng.gitee.io/2022/02/22/%E6%94%BB%E9%98%B2%E4%B8%96%E7%95%8C%E7%9A%84wp/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://heit0ng.gitee.io" target="_blank">heit0ng</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://s2.loli.net/2022/02/22/Wy6vfC23Rpqx8L4.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2022/03/12/c++%E7%9A%84%E7%9F%A5%E8%AF%86(1)/"><img class="prev-cover" src="https://s2.loli.net/2022/03/12/QrwRKYfGEmP3vVL.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">c++的知识(1)</div></div></a></div><div class="next-post pull-right"><a href="/2022/02/19/python/"><img class="next-cover" src="https://s2.loli.net/2022/02/19/Q9FRIvSuonhgz4E.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">python基本语法</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://s2.loli.net/2022/01/28/RkXzVpjubg3yGEI.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">heit0ng</div><div class="author-info__description"></div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">11</div></a></div><div class="card-info-data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a></div><div class="card-info-data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#game"><span class="toc-number">1.</span> <span class="toc-text">game</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#open-source"><span class="toc-number">2.</span> <span class="toc-text">open-source</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#simple-unpack"><span class="toc-number">3.</span> <span class="toc-text">simple-unpack</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#logmein"><span class="toc-number">4.</span> <span class="toc-text">logmein</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#insanity"><span class="toc-number">5.</span> <span class="toc-text">insanity</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#getit"><span class="toc-number">6.</span> <span class="toc-text">getit</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#python-trade"><span class="toc-number">7.</span> <span class="toc-text">python-trade</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#re1"><span class="toc-number">8.</span> <span class="toc-text">re1</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Hello%EF%BC%8CCTF"><span class="toc-number">9.</span> <span class="toc-text">Hello，CTF</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#no-strings-attached"><span class="toc-number">10.</span> <span class="toc-text">no-strings-attached</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#csaw2013reversing2"><span class="toc-number">11.</span> <span class="toc-text">csaw2013reversing2</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#maze"><span class="toc-number">12.</span> <span class="toc-text">maze</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84flag-buuctf"><span class="toc-number">13.</span> <span class="toc-text">不一样的flag(buuctf)</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8D%8E%E5%B8%88%E6%9D%AF2019%E7%9A%84%E8%BF%B7%E5%AE%AB%E9%A2%98"><span class="toc-number">14.</span> <span class="toc-text">华师杯2019的迷宫题</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2023/03/22/j2ee(2)/" title="j2ee(2)"><img src="https://s2.loli.net/2023/03/23/mTDuOeL67MFtgZs.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="j2ee(2)"/></a><div class="content"><a class="title" href="/2023/03/22/j2ee(2)/" title="j2ee(2)">j2ee(2)</a><time datetime="2023-03-22T15:50:01.860Z" title="发表于 2023-03-22 23:50:01">2023-03-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/03/22/j2ee(1)/" title="j2ee(1)"><img src="https://s2.loli.net/2023/03/22/3KqCOLtHBdvhMFe.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="j2ee(1)"/></a><div class="content"><a class="title" href="/2023/03/22/j2ee(1)/" title="j2ee(1)">j2ee(1)</a><time datetime="2023-03-22T12:20:17.683Z" title="发表于 2023-03-22 20:20:17">2023-03-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/05/16/C%E8%AF%AD%E8%A8%80%E5%9B%BE%E4%B9%A6%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/" title="C语言图书管理系统"><img src="https://s2.loli.net/2022/05/16/ae4E7n2D3I5mqkh.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C语言图书管理系统"/></a><div class="content"><a class="title" href="/2022/05/16/C%E8%AF%AD%E8%A8%80%E5%9B%BE%E4%B9%A6%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/" title="C语言图书管理系统">C语言图书管理系统</a><time datetime="2022-05-16T14:28:31.730Z" title="发表于 2022-05-16 22:28:31">2022-05-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/04/07/C++qt/" title="C++Qt"><img src="https://s2.loli.net/2022/04/07/Cyg9WQLqSNxX7Av.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++Qt"/></a><div class="content"><a class="title" href="/2022/04/07/C++qt/" title="C++Qt">C++Qt</a><time datetime="2022-04-07T12:41:19.618Z" title="发表于 2022-04-07 20:41:19">2022-04-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/03/12/c++%E7%9A%84%E7%9F%A5%E8%AF%86(1)/" title="c++的知识(1)"><img src="https://s2.loli.net/2022/03/12/QrwRKYfGEmP3vVL.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="c++的知识(1)"/></a><div class="content"><a class="title" href="/2022/03/12/c++%E7%9A%84%E7%9F%A5%E8%AF%86(1)/" title="c++的知识(1)">c++的知识(1)</a><time datetime="2022-03-12T13:48:26.310Z" title="发表于 2022-03-12 21:48:26">2022-03-12</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By heit0ng</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>